package com.bonc.modules.dial.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bonc.datasource.annotation.DataSource;
import com.bonc.modules.dial.dao.DialTestItemCodeDao;
import com.bonc.modules.dial.entity.DialTestItemCode;
import com.bonc.modules.dial.service.DialTestItemCodeService;
import org.springframework.stereotype.Service;

import java.util.List;

@DataSource("data")
@Service
public class DialTestItemCodeServiceImple extends ServiceImpl<DialTestItemCodeDao, DialTestItemCode> implements DialTestItemCodeService {

    @Override
    public List<DialTestItemCode> queryDialTestItemCode(String prodCode){
        LambdaQueryWrapper<DialTestItemCode> queryWrapper = new LambdaQueryWrapper<>();
        if(ObjectUtil.isNotEmpty(prodCode)){
            queryWrapper.likeRight(DialTestItemCode::getDialtestItemCode, prodCode);
        }
        return baseMapper.selectList(queryWrapper);
    }

}
